import Vue from 'vue'
import App from './App.vue'

// 引入路由
import router from './router';
// 引入路由守卫
import '@/permisstion'
import store from './store';
// 关闭语法检查
Vue.config.productionTip = false
// 引入默认样式
import './assets/reset.css'
// 引入swiper
import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
// 引入swiper样式
import 'swiper/css/swiper.min.css'
// 引入mock
import "@/mock/mockServer"
// 引入Element ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI)

// 图片懒加载(插件)
import loadimage from '@/assets/JZZ.gif'
import errimage from '@/assets/404.gif'
import VueLazyload from 'vue-lazyload';
Vue.use(VueLazyload,{
  preload:1.5,
  error:errimage,
  loading:loadimage,
})
// 引入表单校验的插件
import '@/utils/veevalidate'

// 注册全局组件
import Header from './components/header/Header.vue'
import Footer from './components/footer/Footer.vue'
import TypeNav from './components/typeNav/TypeNav.vue'
import Pagination from './components/pagination/Pagination.vue'
Vue.component('Header', Header)
Vue.component('Footer', Footer)
Vue.component('TypeNav', TypeNav)
Vue.component('Swiper', Swiper)
Vue.component('SwiperSlide', SwiperSlide)
Vue.component('Pagination',Pagination)

// 创建Vue对象实例
new Vue({
  render: h => h(App),
  router,
  store,
  beforeCreate() {
    Vue.prototype.$bus = this

  }
}).$mount('#app')
